@extends('layouts.buz.layout')
@section('content')

    <div id="sidebar" class="collapse navbar-collapse col-md-2 col-sm-3">
        <!-- Start .sidebar-inner -->
        <div class="sidebar-inner">
            <div class="commonMoeny">
                <h4 class="ktimoney">
                    可提现金额<br>
                    <em class="red">￥782.00</em>
                </h4>
                <h4 class="ktimoney">
                    账户余额<br>
                    <em class="red">￥782.00</em>
                </h4>
                <h4 class="ktimoney">
                    结算中金额<br>
                    <em class="red">￥782.00</em>
                </h4>
                <h4 class="ktimoney ">
                    累计已计算金额<br>
                    <em class="red">￥782.00</em>
                </h4>
            </div>

            <ul id="sideNav" class="nav nav-pills nav-stacked">
                <li class="on">
                    <a href="/remit/topay">
                        <div class="col-sm-9">
                            <h4>代付</h4>
                        </div>
                        <div class="col-sm-3">
                            <i class="arrowW"></i>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="/remit/topayList">
                        <div class="col-sm-9">
                            <h4>代付记录</h4>
                        </div>
                        <div class="col-sm-3">
                            <i class="arrowH"></i>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="/remit/withdraw">
                        <div class="col-sm-9">
                            <h4>提现</h4>
                        </div>
                        <div class="col-sm-3">
                            <i class="arrowH"></i>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="/remit/withdrawList">
                        <div class="col-sm-9">
                            <h4>提现记录</h4>
                        </div>
                        <div class="col-sm-3">
                            <i class="arrowH"></i>
                        </div>
                    </a>
                </li>
            </ul>
        </div>
        <!-- End .sidebar-inner -->
    </div>

    <div class="yhy-member col-sm-9 col-sm-push-3 col-md-10 col-md-push-2 col-xs-12">
        <h4 class="labatx">
            <img src="{{asset('image/laba.png')}}" width="50px" height="50px" />
            各位商户，0:00-2:00为银行系统升级维护时间，为保证您资金能成功提现或代付，建议您在2:00以后进行此类操作
        </h4>
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    代付
                    <button type="button" class="btn btn-primary right" id="btnBatch">批量代付</button>
                    <button type="button" class="btn btn-primary right" style="margin-right: 20px" id="btnReview">复核</button>
                </h4>
            </div>
            <div class="panel-body">
                <form class="form-horizontal member" role="form" id="daifu">
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="form-group">
                                <label for="firstname" class="col-sm-3 control-label">收款方姓名</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="code">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="form-group">
                                <label for="firstname" class="col-sm-3 control-label">账户类型</label>
                                <div class="col-sm-8 y-mt6">
                                    <input type="radio" value="" name="jrtype" checked="checked" />&nbsp;企业&nbsp;&nbsp;&nbsp;
                                    <input type="radio" value="" name="jrtype" />&nbsp;个人
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="form-group">
                                <label for="name" class="col-sm-3 control-label">收款方开户行</label>
                                <div class="col-sm-8">
                                    <select class="form-control col-sm-3">
                                        <option>中国农业银行</option>
                                        <option>中国银行</option>
                                        <option>3</option>
                                        <option>4</option>
                                        <option>5</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="form-group">
                                <label for="firstname" class="col-sm-3 control-label">收款方开户银行卡号</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="code">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-8">
                            <label for="firstname" class="col-sm-3 control-label">开户行所在地</label>
                            <div class="col-sm-4">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <select class="form-control col-sm-3">
                                            <option>中国农业银行</option>
                                            <option>中国银行</option>
                                            <option>3</option>
                                            <option>4</option>
                                            <option>5</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-4">
                                <div class="form-group">
                                    <div class="col-sm-12">
                                        <select class="form-control col-sm-3">
                                            <option>中国农业银行</option>
                                            <option>中国银行</option>
                                            <option>3</option>
                                            <option>4</option>
                                            <option>5</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="form-group">
                                <label for="lastname" class="col-sm-3 control-label">开户行支行名称</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="mobile">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="form-group">
                                <label for="firstname" class="col-sm-3 control-label">打款金额</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="code">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="form-group">
                                <label for="firstname" class="col-sm-3 control-label">到账时间</label>
                                <div class="col-sm-8 y-mt6">
                                    <input type="checkbox" >&nbsp;&nbsp;普通&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input type="checkbox" >&nbsp;&nbsp;加急
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="form-group">
                                <label for="firstname" class="col-sm-3 control-label">打款原因</label>
                                <div class="col-sm-8">
                                    <input type="text" class="form-control" name="code">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="form-group">
                                <label for="firstname" class="col-sm-3 control-label"></label>
                                <div class="col-sm-8">
                                    <button type="button" class="btn btn-primary" id="forgetNext">下一步</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
@endsection()
@section('dialog')
    {{--批量代付弹窗--}}
    <div class="modal fade in" id="accountTopayMore" tabindex="-1" role="dialog"  aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header y-modal-header-default">
                    <h3 class="y-mg0">批量代付
                        <button type="button" class="close" data-dismiss="modal">
                            <span aria-hidden="true">×</span>
                        </button>
                    </h3>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal y-mt15 ng-pristine ng-valid" action="" id="batchForm" method="post" enctype="multipart/form-data">
                        <fieldset>
                            <div class="form-group">
                                <label class="col-sm-4 control-label" for="">付款文件</label>
                                <div class="col-sm-8">
                                    <input class="y-mt10" type="file" name="entrustFile">
                                    <p class="text-left y-mt10">模板文件下载：
                                        <a href="" class="btn btn-link">模板文件</a>
                                    </p>
                                </div>
                            </div>
                        </fieldset>
                    </form>
                </div>
                <div class="modal-footer y-modal-footer-default">
                    <button type="button" class="btn y-btn-blue center-block" id="batchNext">下一步</button>
                </div>
            </div>
        </div>
    </div>
    {{--复核弹窗--}}
    <div class="modal fade in" tabindex="-1" role="dialog" aria-hidden="true" id="accountReview">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header y-modal-header-default">
                    <h3 class="y-mg0">复核
                        <button type="button" class="close" >
                            <span class="close" data-dismiss="modal" aria-hidden="true">×</span>
                        </button>
                    </h3>
                </div>
                <div class="modal-body pt0">
                    <div class="row y-mlr0 y-bb1">
                        <div class="col-sm-3">
                            <div class="y-transition-color-info mt40">
                                <p class="y-fw-n">总笔数</p>
                                <div class="y-box-sm y-transition-border-color-info"><span class="spanYell" id="spanEntrustCount">0</span></div>
                            </div>
                        </div>
                        <div class="col-sm-3 yhy-account-head-center y-ml-1">
                            <div class="y-transition-color-info mt40">
                                <p>商家实付(元)</p>
                                <div class="y-box-sm y-transition-border-color-info"><span class="spanYell" id="spanEntrustAmount">0</span></div>
                            </div>
                        </div>
                        <div class="col-sm-6">
                            <form class="form-horizontal mt20" role="form" id="register">
                                <div class="form-group">
                                    <label for="lastname" class="col-sm-3 textRight">验证码：</label>
                                    <div class="col-sm-5">
                                        <input type="text" class="form-control" name="mobile">
                                    </div>
                                    <div class="col-sm-4">
                                        <button type="button" class="btn btn-info" id="sendCode">发送验证码</button>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label for="firstname" class="col-sm-3 textRight">交易密码：</label>
                                    <div class=" col-sm-5">
                                        <input type="text" class="form-control" name="code">
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                    <div class="table-responsive mt20">
                        <table class="table table-striped table-hover table-bordered y-ws-n y-table-md">
                            <thead>
                            <tr>
                                <th></th>
                                <th>
                                    <label class="">
                                        <input type="checkbox" name="chkAll" id="chkAll">
                                        <span class="y-ml2">全选</span>
                                    </label>
                                </th>
                                <th>发起时间</th>
                                <th>姓名</th>
                                <th>帐号</th>
                                <th>银行</th>
                                <th>分行</th>
                                <th>联行号</th>
                                <th>省份</th>
                                <th>城市</th>
                                <th>收款人实收</th>
                                <th>出款通道</th>
                                <th>打款原因</th>
                            </tr>
                            </thead>
                            <tbody>

                            <tr>
                                <td colspan="14" style="text-align:center;">暂时未查询到任何记录</td>
                            </tr>

                            </tbody>
                        </table>
                    </div>

                </div>
                <div class="modal-footer y-modal-footer-default">
                    <button type="button" class="btn btn-info" onclick="return submitForm(1)">复核通过</button>
                    <button type="button" class="btn btn-danger" onclick="return submitForm(0)">拒绝</button>
                </div>
            </div>
        </div>

    </div>
@endsection()
@section('bottom_js')
    <script>
        $(function(){
            $("#btnBatch").click(function(){
                $("#accountTopayMore").modal('toggle');
            })
        });
        $("#btnReview").click(function(){
            $("#accountReview").modal("toggle");
        });
        // 批量代付提交
        $("#batchNext").click(function(){
            var formData = new FormData($("#batchForm")[0]);
            $.ajax({
                type : "post",
//                url : "/front/cashFlow/payForAnotherInformationList.htm",
                data : formData,
                contentType: false, //必须
                processData: false, //必须
                beforeSend: function () {
                    $("#batchNext").attr('disabled', 'disabled');
                },
                success : function(data){
                    if(data.result == "0") {
//                        $("#topayConfirmForm").attr("action", "/front/cashFlow/topayConfirm.htm");
//                        $("#entrustNo").val(data.data);
//                        $("#alertMsg").val(data.message);
//                        $("#topayConfirmForm").submit();
                    }
                    else {
                        $("#accountTopayMore").modal('toggle');
                        showMsg(data.message);
                        $("#batchNext").removeAttr('disabled');
                    }
                },
                dataType: "json"
            });
        });
    </script>
@endsection()